package com.rising.face.lock.ReentrantLock;

/**
 * @Author: rising
 * @Description:
 * @Date: create in 2021/1/10 14:47
 */
public class ShareDataSourceTest {
    public static void main(String[] args) {
        ShareDataSource dataSource = new ShareDataSource();
        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                dataSource.publicPrint5();
                //dataSource.publicPrint("AA", 5);
                //dataSource.publicPrint2("AA", 5);
            }
        },"AA").start();

        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                dataSource.publicPrint10();
                //dataSource.publicPrint("BB", 10);
                //dataSource.publicPrint2("BB", 10);
            }
        },"BB").start();

        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                dataSource.publicPrint15();
                //dataSource.publicPrint("CC", 15);
                //dataSource.publicPrint2("CC", 15);
            }
        },"CC").start();
    }
}
